feat(Badge): support a contextual help - #3049
Conversation
Coverage Report for ./packages/components/
File CoverageNo changed files found. |
900bd51 to
380c730
Compare
380c730 to
6dd9054
Compare
A Button, CopyButton, Action, ContextualHelpTrigger or ModalTrigger in the badge content is moved to the end of the badge and rendered like the onClose icon. With both, the close icon stays rightmost. Triggers move along with their button — a button tunneled out on its own mounts outside the trigger and loses its press behavior. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
6dd9054 to
f340da9
Compare
🚀 Preview DeploymentPreview environments are ready:
Images:
|
Co-authored-by: Lisa18289 <84317589+Lisa18289@users.noreply.github.com>
The badge does not remove itself — onClose renders the X and calls the handler, which decides what happens. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The two cases that carry the feature — a button after the text, with and without the close icon — move into "Badge colors", so every color and both alpha variants cover them. Drops the separate "Badge actions" scenario. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Lisa18289 <84317589+Lisa18289@users.noreply.github.com>
Matches the "Mit Button" section it sits under. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The screenshots cover what the trailing button looks like and where it sits, in every color. What is left asserts the wiring: a button leaves the content, and action, modal and contextual help still fire from inside the badge. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
WithContextualHelp shows the trailing button; the close icon has its own story. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Scope: contextual help, not buttons in generalAgreed with Lisa that this extension is not about general button support in a badge — it is about supporting So I would rather reuse the known pattern from <Badge>
<Label>Priorität</Label>
<Text>Hoch</Text>
<ContextualHelpTrigger subject="Priorität">
<Button />
<ContextualHelp>
<Text>Tickets mit hoher Priorität werden zuerst bearbeitet.</Text>
</ContextualHelp>
</ContextualHelpTrigger>
</Badge>to <Badge>
<Label>Priorität</Label>
<Text>Hoch</Text>
<ContextualHelp>
<Text>Tickets mit hoher Priorität werden zuerst bearbeitet.</Text>
</ContextualHelp>
</Badge>
That API expresses precisely what is supported here: contextual help. Generic |
A ContextualHelp in the badge content is placed at the end of the badge, and the badge supplies the trigger button — so the consumer writes only the help, the pattern ListItemView already uses for ContextMenu. Button, CopyButton, Action and ModalTrigger are no longer tunneled: contextual help is what this supports, and the API now says so. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Done — the badge now takes a <Badge>
<Label>Priorität</Label>
<Text>Hoch</Text>
<ContextualHelp>…</ContextualHelp>
</Badge>
One consequence worth naming: the trigger's |
A
ContextualHelpin the badge content renders at the end of the badge, shaped and colored like theonCloseicon. With both, the close icon stays rightmost. The badge supplies the trigger button, so a consumer writes only the help:That is the pattern
ListItemViewalready uses forContextMenu: a props context tunnels the overlay to a slot at the end and wraps it with the button viawrapWith.Verification: browser tests cover that the help opens from the badge's own button and that a disabled badge disables it. The
Badge colorsvisual scenario carries the button through every color and both themes, in the Local and the Remote environment.🤖 Generated with Claude Code